package director;

import creational.factory.Factory;
import creational.factory.GenericFactory;
import creational.factory.Product;
import creational.factory.impl.Benz;
import creational.factory.impl.BenzFactory;

public class FactoryDirector {

    public static void main(String[] args) {
        Factory benzFactory = new BenzFactory();
        Product benzA = benzFactory.create();
        System.out.println(benzA);

        try {
            Product benzB = GenericFactory.create(Benz.class);
            System.out.println(benzB);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
